﻿<Window x:Class="BBInterfaceNET.Views.NewProjectView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="{Binding Title}" MinWidth="300" SizeToContent="WidthAndHeight">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid Grid.Row="0" Grid.ColumnSpan="2" Margin="2">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <TextBlock Text="OS Ver." VerticalAlignment="Center"/>
            <ComboBox Grid.Column="1" ItemsSource="{Binding OsInfos}" x:Name="cbVer"
                      SelectedItem="{Binding SelectedOs, Mode=TwoWay}">
                <ComboBox.ItemTemplate>
                    <DataTemplate>
                        <TextBlock Text="{Binding Name}"/>
                    </DataTemplate>
                </ComboBox.ItemTemplate>
            </ComboBox>
            <TextBlock Text="Device" Grid.Column="2" VerticalAlignment="Center"/>
            <ComboBox Grid.Column="3" ItemsSource="{Binding ElementName=cbVer, Path=SelectedItem.Devices}"
                      SelectedItem="{Binding Path=SelectedDevice, Mode=TwoWay}">
                <ComboBox.ItemTemplate>
                    <DataTemplate>
                        <TextBlock Text="{Binding Name}"/>
                    </DataTemplate>
                </ComboBox.ItemTemplate>
            </ComboBox>
        </Grid>
        
        <TextBlock Text="Project Name:" Margin="2" VerticalAlignment="Center" Grid.Row="1"/>
        <TextBox Grid.Column="1" Grid.Row="1" Margin="2" Text="{Binding Path=ProjectName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
        <TextBlock Text="Project Path:" Grid.Row="2" Margin="2" VerticalAlignment="Center"
                   HorizontalAlignment="Right"/>
        <Grid Grid.Row="2" Grid.Column="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <TextBox Margin="2" Text="{Binding Path=ProjectPath, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
            <Button Content="..." Grid.Column="1" Padding="5,1" Command="{Binding BrowseCommand}" />
        </Grid>
        
        <CheckBox Grid.Column="1" Grid.Row="3" Margin="2"
                  IsChecked="{Binding Path=CreateProjectDirectory, Mode=TwoWay}"
                    Content="Create Project Directory"/>
        
        <StackPanel Grid.ColumnSpan="2" Orientation="Horizontal" Margin="2"
                    HorizontalAlignment="Right" Grid.Row="4">
            <Button Content="Ok" Padding="5,1" Margin="2" IsDefault="True" Click="btnOk_Click"/>
            <Button Content="Cancel" Padding="5,1" Margin="2" IsCancel="True" Click="btnCancel_Click"/>
        </StackPanel>
    </Grid>
</Window>
